﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<JobDescOnline.Presentation.Models.JobDescriptionStep1>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create Job Description - Review JobDesc!
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        function JobCombo(departmentID) {
            if (departmentID != "") {
                $.ajax({
                    url: "/JobTitle/Combo",
                    type: "POST",
                    data: { DepartmentID: departmentID, Name: "JobTitleID" },
                    success: function (msg) {
                        if (msg) {
                            $("#JobTitleBody").html(msg);
                        }
                    }
                });

                $.ajax({
                    url: "/JobTitle/Combo",
                    type: "POST",
                    data: { DepartmentID: departmentID, Name: "ReportToJobTitleID" },
                    success: function (msg) {
                        if (msg) {
                            $("#ReportToBody").html(msg);
                        }
                    }
                });
            } else {
                $("#JobTitleBody").html("");
                $("#ReportToBody").html("");
            }

            return false;
        }

        function JobTitleChange(ID) {
            return false;
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Job Description - Data Baru!</h2>

    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm()) { %>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>1. Job Identification:</legend>
            <table class="entry">
                <tr>
                    <td style="width: 230px;"><%: Html.LabelFor(model => model.DepartmentID) %></td>
                    <td>
                        <%: Html.DropDownList("DepartmentID", (IEnumerable<SelectListItem>)HttpContext.Current.Application["ComboDepartment"], "--Select One--", new { onChange = "JobCombo(this.value);" } )%>
                        <%: Html.ValidationMessageFor(model => model.DepartmentID) %>
                    </td>
                </tr>
                <tr>
                    <td><%: Html.LabelFor(model => model.JobTitleID) %></td>
                    <td>
                        <div id="JobTitleBody"></div>
                        <%: Html.ValidationMessageFor(model => model.JobTitleID) %>
                    </td>
                </tr
                <tr>
                    <td><%: Html.LabelFor(model => model.ReportToJobTitleID) %></td>
                    <td>
                        <div id="ReportToBody"></div>
                        <%: Html.ValidationMessageFor(model => model.ReportToJobTitleID) %>
                    </td>
                </tr>
                <tr>
                    <td><%: Html.LabelFor(model => model.Location) %></td>
                    <td>
                        <%: Html.DropDownList("Location", (IEnumerable<SelectListItem>)HttpContext.Current.Application["Location"], "--Select One--")%>
                        <%: Html.ValidationMessageFor(model => model.Location) %>
                    </td>
                </tr>
            </table>
        </fieldset>
        <fieldset>
            <legend>2. <%: Html.LabelFor(model => model.JobPurpose) %>:</legend>
            <%: Html.TextAreaFor(model => model.JobPurpose, new { style="width: 900px", rows="5" })%>
            <%: Html.ValidationMessageFor(model => model.JobPurpose) %>
        </fieldset>

        <input type="submit" value="Simpan & Lanjutkan" />
    <% } %>

    <div><%: Html.ActionLink("Kembali", "Index") %></div>
</asp:Content>